find_path(qpOASES_INCLUDE_PATH include/qpOASES.hpp)
find_library(qpOASES_LIBRARY libqpOASES.so)
find_library(qpOASES_LIBRARY libqpOASES)

if(qpOASES_INCLUDE_PATH AND qpOASES_LIBRARY)
  set(qpOASES_FOUND TRUE)
endif()
if(qpOASES_FOUND)
  message(STATUS "Found qpOASES installed in: ${qpOASES_INCLUDE_PATH}")
  set(qpOASES_INCLUDE_DIRS ${qpOASES_INCLUDE_PATH}/include)
  set(qpOASES_LIBRARIES ${qpOASES_LIBRARY})
  include(FindPackageHandleStandardArgs)
  find_package_handle_standard_args(qpOASES DEFAULT_MSG
    qpOASES_LIBRARIES qpOASES_INCLUDE_DIRS)
  mark_as_advanced(qpOASES_INCLUDE_DIRS qpOASES_LIBRARIES)
else(qpOASES_FOUND)
  if(qpOASES_FIND_REQUIRED)
    message(FATAL_ERROR "Could not find qpOASES library.")
  endif(qpOASES_FIND_REQUIRED)
endif(qpOASES_FOUND)
